Socket
Socket
Sign inDemoInstall

@hig/tooltip

Package Overview
Dependencies
Maintainers
4
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hig/tooltip

HIG Tooltip


Version published
Weekly downloads
26
increased by8.33%
Maintainers
4
Weekly downloads
 
Created
Source

Tooltip

Tooltips generally describe what a tool or feature does, or when or how to use it.

Read more about when and how to use the Tooltip component on the internal wiki.

Getting started

Install the package

yarn add @hig/tooltip @hig/theme-context @hig/theme-data

Import the component

import Tooltip from '@hig/tooltip';

Basic usage

<Tooltip anchorPoint="top-center" content="Testing tooltip">
  <Button title="Open Tooltip" />
</Tooltip>

Styling

Use the className prop to pass in a css class name to the outermost container of the component. The class name will also pass down to most of the other styled elements within the component.

Toolt also has a stylesheet prop that accepts a function wherein you can modify its styles. For instance

import Tooltip from '@hig/tooltip';

function YourComponent() {
  // ...
  const customStylesheet = (styles, props, themeData) => ({
    ...styles,
    content: {
      ...styles.content,
      color: themeData["colorScheme.status.error"]
    },
    panel: {
      ...styles.panel,
      opacity: 1
    },
    panelInner: {
      ...styles.panelInner,
      padding: `4px`
    },
    textContent: {
      ...styles.textContent,
      position: `static`
    }
  });

  return (
    <Tooltip stylesheet={customStylesheet} />
  );
}

FAQs

Package last updated on 05 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc